package com.springboot.service;

import com.springboot.dao.OperationLogDao;
import com.springboot.domain.OperationLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class OperationLogServiceI implements BaseService<OperationLog> {


    @Autowired
    private OperationLogDao old;

    @Override
    public List<OperationLog> find(OperationLog operationLog) {
        return null;
    }

    @Override
    public OperationLog get(OperationLog operationLog) {
        return null;
    }

    @Override
    public Map<String, Object> add(OperationLog operationLog) {
        operationLog = old.save(operationLog);
        Map<String, Object> map = new HashMap<>();
        map.put("is",operationLog.getId()!=null?true:false);
        map.put("msg",operationLog.getId()!=null?"成功":"失败");
        map.put("obj",operationLog);
        return map;
    }

    @Override
    public Map<String, Object> edit(OperationLog operationLog) {
        return null;
    }

    @Override
    public Map<String, Object> remove(OperationLog operationLog) {
        return null;
    }
}
